package group2assignone.ucm.manager;

import group2assignone.model.Flight;
import group2assignone.ucm.UCController;
import group2assignone.view.manager.CreateFlightView;

/**
 * Use Case: Create Flight Next                                         <br>
 * Pre-Condition: Manager inputs flight details and selects 'Next'      <br>
 * from the create flight view                                          <br>
 * Post-Condition: UI is updated                                        <br>
 * 1. System stores entered flight details.                             <br>
 * 2. System updates UI to show flight details.                         <br>
 *
 * @author group2
 */
public class UCCreateFlightNext implements UCController {

    private CreateFlightView flightView = new CreateFlightView();
    private Flight f = new Flight();

    /**
     * set view and flight
     * @param fView
     * @param flight
     */
    public UCCreateFlightNext(CreateFlightView fView, Flight flight) {
        flightView = fView;
        f = flight;
    }

     /**
     *Use Case Controller - changes UI to allow confirmation of flight details.
     */
    @Override
    public void run() {
        //1. System stores entered flight details.
        flightView.loadDetails(f);
        //2. System updates UI to show flight details.
        flightView.showNewFlight(f);
    }
}
